import kDimensionReduce as RD
import numpy as np
import pandas as pd

print("Hello World")
# print(RD.TestPYCPPConnect(4, 3))
# test_data = np.random.rand(536,43)
# test_data = np.random.rand(100, 17)
# print(test_data)
# y_data = RD.LLE_Run(test_data, 5, 17, False, "")


def stupid_convert(df):
    array_data = np.array(df_data)
    #
    rows = array_data.shape[0]
    cols = array_data.shape[1]
    x_data = np.empty(shape=[0, cols])
    for i in range(rows):
        x_data = np.append(x_data, [array_data[i]], axis=0)
    #
    return x_data

df_data = pd.read_csv("C:\\Users\\fengshimeng3\Documents\财富管理-智能投顾\Debug\error2\lle_data-l3.csv", header = None)
print(df_data)
test_data = stupid_convert(df_data)

print("converted data")
print(test_data)


rows = test_data.shape[0]
cols = test_data.shape[1]
print("Data Shape", rows, cols)
print(test_data)

# optimal_k = RD.LLE_Find_K(test_data, 5, 5, 30, "", False)
# print("optimal K", optimal_k)

optimal_m = RD.LLE_Find_M(test_data, 71, 0.95, True)
print("optimal M", optimal_m)

# y_data = RD.LLE_Run(test_data, 5, 43, False, "")
# print(y_data)